{layout name='./base/base_back'}
	<link rel="stylesheet" type="text/css" href="/front/css/wishList.css"/>
	<script src="/front/js/jquery.js"></script>
		<!--[if lt IE 9]>  
  			<script src="/front/js/jquery1.8.js"></script>
		<![endif]-->
	<script src="/front/js/index.js"></script>
	<link rel="stylesheet" type="text/css" href="/front/css/jquery-ui.css"/>
	<script src="/front/js/jquery-ui.js"></script>
	<script src="/front/js/weifeng.js"></script>
	<style type="text/css">
		#many-look{
			width: 100%;
			height: 35px;
			text-align: center;
			background-color: #2692e0;
			line-height: 35px;
			color: #FFFFFF;
			cursor: pointer;
		}
	</style>
	<!--心愿单列表开始-->
	<div id="wish-box">
		<!--搜索部分开始-->
		<div id="wish-search">
			<div class="position-flow">
				<span style="font-size: 16px;">您的位置：</span>
				<span class="present-place">首页 > 需求接单</span>
			</div>
			<form action="/wishs/AllWishList" method="get">
				<div class="wish-search-if">
					<div class="wish-time">
						{if input('get.start_date') && input('get.end_date')}
						<label for="">开始时间：<input type="text" name="start_date" id="selstartdate" value="{:input('get.start_date')}" placeholder="请选择出行时间"/></label>
						<label for="">结束时间：<input type="text" name="end_date" id="selendate" value="{:input('get.end_date')}" placeholder="请选择结束时间"/></label>
						{else /}
						<label for="">开始时间：<input type="text" name="start_date" id="selstartdate" value="" placeholder="请选择出行时间"/></label>
						<label for="">结束时间：<input type="text" name="end_date" id="selendate" value="" placeholder="请选择结束时间"/></label>
						{/if}
					</div>
					<div class="wish-button">
						<button type="submit">搜索需求</button>
					</div>
				</div>
			</form>
		</div>
		<!--搜索部分结束-->
		<!--内容部分开始-->
		<div id="wish-list-box">
			{if empty($list) && input('get.start_date') && input('get.end_date')}
			<div style="line-height: 86px; font-size: 25px; text-align: center; background-color: #eee;color: #2692e0;">
				抱歉该时间段没有合适的心愿！您可以更换其他时间！
			</div>
			{else /}
			<ul class="wish-list" id="append">
				{foreach $list as $v}
				<li class="wish-group-li">
					<div class="wish-site-time">
						<p>目的地:<span>{$v.city}</span></p>
						<p>{$v.start_date}<span>To</span>{$v.end_date}</p>
					</div>
					<div class="wish-order-wanted">
						<!--删除悬赏现金-->
					</div>
					<div class="wish-order-wanted">
						<p>悬赏</p>
						<p>旅行币<i style="margin: 0 5px;">{$v.score}</i></p>
					</div>
					<div class="rush-wish-order">
						<a href="/wishs/acceptorder?id={$v.id}">抢单</a>
					</div>
				</li>
				{/foreach}
			</ul>
			{/if}
		</div>
		{if !empty($list)}
		<div style="width: 100%;">
			<ul style="width: 1200px; margin: 0 auto; margin-top: 10px;">
				<h2 id="many-look">查看更多</h2>
			</ul>
		</div>
		{/if}
		<!--内容部分结束-->
		<!--接单规则弹出框开始-->
		<div id="receiving-rule" style="display: none;">
			<form id="form" action="javaScript:;" method="post">
				<div class="receiving-rule-bg"></div>
				<div class="receiving-rule-bounced">
					<div class="rule-bounced" style="background:#fff;">
						<p>确认接单吗？</p>
						<dl>
							<dt>接单规则</dt>
							<dd>1. 确认接单后，则在24小时内，在接单的时间段不可再分享自己的房车。</dd>
							<dd>2. 系统自动将您的接单请求发送给心愿方。请耐心等待对方确认。</dd>
							<dd>3. 经对方同意并确认，提交订单付款，交易成功。悬赏金额将在心愿方会员入住成功后到账。</dd>
							<dd>4. 请留意接单反馈情况消息通知。</dd>
							<dd>5. 一旦接单，表示您同意《双辉旅程网交换规则》。</dd>
						</dl>
						<div class="rule-bounced-button">
							<a id="quxiao" href="javaScript:;">取消</a><!--<a id="queding" href="javaScript:;">确定</a>-->
							<button type="submit">确定</button>
						</div>
					</div>
				</div>
			</form>
		</div>
		<!--接单规则弹出框结束-->
		<script type="text/javascript">
			$('#wish-list-box').on("click",".wish-group-li a",function(){
				var id = $(this).attr('href');
				$(this).attr('href','javaScript:;');
				$('#receiving-rule').show();
				$('#receiving-rule #form').attr('action',id);
			})
			
			$('#receiving-rule #quxiao').click(function(){
				$('#receiving-rule').hide();
			})
			$('#wish-list-box .wish-group-li').eq(0).css('margin-top','0px');
			//获取更多心愿
			page = 2;
			$('#many-look').click(function(){
				var that = $(this);
				var start_date = $('#selstartdate').val();
				var end_date = $('#selendate').val();
				$.ajax({
					type:"post",
					url:"/wishs/getmanywish?"+Math.random(),
					data:{start_date:start_date,end_date:end_date,page:page},
					dataType:'json',
					success:function(data){
						if(data==''){
							that.text('已加载到最多');
							that.unbind("click");
						}
						page++;
						var list = '';
						$.each(data, function(v,wishList) {
							list+='<li class="wish-group-li">\
								<div class="wish-site-time">\
									<p>目的地:<span>'+wishList.city+'</span></p>\
									<p>'+wishList.start_date+'<span>To</span>'+wishList.end_date+'</p>\
								</div>\
								<div class="wish-order-wanted">\
								</div>\
								<div class="wish-order-wanted">\
									<p>悬赏</p>\
									<p>旅行币<i style="margin: 0 5px;">'+wishList.score+'</i></p>\
								</div>\
								<div class="rush-wish-order">\
									<a href="/wishs/acceptorder?id='+wishList.id+'">抢单</a>\
								</div>\
							</li>';
						});
						$('#append').append(list);
					}
				});
			})
		</script>
	</div>
	<!--心愿单列表结束-->
